{include file="public/head" /}
{include file="public/js_ueditor" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{:lang('g_system')} {:lang('v_setting')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('g_system')} {:lang('v_setting')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_email')} {:lang('v_setting')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_aliyun_directmail')}</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card card-outline card-success">
                            <div class="card-header"><i class="fas fa-fw fa-cogs mr-1"></i>{:lang('v_config_setting')}</div>
                            <div class="card-body">
                                <form name="form_edit" id="form_edit" method="post" action="{:url('/email/edit',['lang'=>$lang])}">
                                    <input type="hidden" name="lang" value="{$lang}">
                                    <input type="hidden" name="type" value="{:input('type')}">
                                    <div class="row form-group">
                                       <div class="offset-md-3 col-md-4"><i class="fa fa-envelope mr-2"></i>{:lang('v_aliyun_directmail')} 【 <a href="https://www.aliyun.com/product/directmail?source=5176.11533457&userCode=mh7g2yy8" target="_blank">{:lang('v_apply')} &raquo;</a> 】</div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_server_ip')}</div>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control" name="aliyun_smtp" value="{:config('email.aliyun.smtp')}" />
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_server_port')}</div>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control" name="aliyun_port" value="{:config('email.aliyun.port')}" />
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_send_account')}（Email {:lang('v_address')}）</div>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control" name="aliyun_username" value="{:config('email.aliyun.username')}" />
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_send_password')}</div>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control" name="aliyun_password" value="******" />
                                        </div>
                                    </div>
                                    <div class="row form-group d-none">
                                        <div class="col-md-3 col-form-label text-right">{:lang('v_trans_mode')}</div>
                                        <div class="col-md-4">
                                            <input type="text" class="form-control" name="aliyun_passmethod" value="{:config('email.aliyun.passmethod')}" />
                                        </div>
                                    </div>
                                    <div class="row form-group {if config('app.other.system_type') eq 'company'}d-none{/if}">
                                        <div class="col-md-3 col-form-label text-right">发送验证码模板</div>
                                        <div class="col-md-4">
                                            <select name="captcha_template" class="form-control">
                                                {volist name="template" id="tempRs"}
                                                    <option value="{$tempRs.id}" {if config('email.template.captcha') eq $tempRs.id}selected="selected"{/if}>{$tempRs.att_type}</option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 text-right">发邮件给管理员</div>
                                        <div class="col-md-9">
                                            <label class="form-check form-check-inline" id="feedback"><input name="feedback[]" type="checkbox" value="1" {if config('email.sendmail.feedback') eq 1}checked="checked"{/if} class="form-check-input" /> {:lang('v_feedback')}</label>
                                        </div>
                                    </div>
                                    <div {if config('email.sendmail.feedback') neq 1}class="d-none"{/if} id="feedback_template">
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">留言邮件模板</div>
                                            <div class="col-md-4">
                                                <select name="feedback_template" class="form-control">
                                                    {volist name="template" id="tempRs"}
                                                        <option value="{$tempRs.id}" {if config('email.template.feedback') eq $tempRs.id}selected="selected"{/if}>{$tempRs.title}</option>
                                                    {/volist}
                                                </select>
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">管理员邮箱</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="admin_email" value="{:config('email.admin_email')}" />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row form-group">
                                        <div class="col-md-3 text-right">发送记录写入数据库</div>
                                        <div class="col-md-9">
                                            <label class="form-check form-check-inline">
                                                <input type="radio" name="insert_database" value="0"{if empty(config('email.insert_database'))} checked="checked"{/if} class="form-check-input" />{:lang('v_no')}
                                            </label>
                                            <label class="form-check form-check-inline">
                                                <input type="radio" name="insert_database" value="1"{if config('email.insert_database') eq 1} checked="checked"{/if} class="form-check-input" />{:lang('v_yes')}
                                            </label>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="offset-md-3 col-md-9 mb-4">
                                            {if is_file(app()->getRootPath().'.env')}
                                                <button type="submit" class="do_ajax btn btn-success mr-4"><i class="fas fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                            {else /}
                                                <button type="button" class="do_ajax btn btn-success mr-4" onclick="javascript:do_ajax('#form_edit','.do_ajax','{:url('/email/edit',['lang'=>$lang])}','{:url('/email/index',['lang'=>$lang])}');"><i class="fas fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                            {/if}
                                            <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);"><i class="fa fa-angle-double-left mr-1"></i>{:lang('v_goback')}</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
<script type="text/javascript">
$('#feedback').click(function(){
    var val = '';
    $('input:checkbox[name="feedback[]"]:checked').each(function(i){
        val = $(this).val();
    });
    if(!val){
        $('#feedback_template').addClass('d-none');
    }else{
        $('#feedback_template').removeClass('d-none');
    }
})
</script>
</body>
</html>